package com.lagou.edu.util;

import java.util.Random;

/**
 * @author bobcheng
 * @date 2020/7/12
 */
public class CaptchaUtil {

    private CaptchaUtil() {
    }

    public static String genCode(int length) {
        StringBuilder sb = new StringBuilder();
        Random rand = new Random();
        for (int i = 0; i < length; i++) {
            sb.append(rand.nextInt(10));
        }
        return sb.toString();
    }

}
